<%@ page import="dex.micros_gdc.Task" %>

<g:javascript>
	$(document).ready(function()
	{
	  $("#duedatepicker").datepicker({dateFormat: 'mm/dd/yy'});
	  $("#receiveddatepicker").datepicker({dateFormat: 'mm/dd/yy'});
	  $("#completeddatepicker").datepicker({dateFormat: 'mm/dd/yy'});

      var $aType = $("#aType");

	  $aType.change(function() {
	    var aTypeValue = $aType.val();

 		if("E" == aTypeValue) {
 		  document.getElementById("testByGDCFlagDiv").style.display = "none";
 		} else {
 		  document.getElementById("testByGDCFlagDiv").style.display = "";
 		}
	  });
	})
</g:javascript>


<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'projectName', 'error')} required">
	<label for="projectName">
		<g:message code="task.projectName.label" default="Project Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="projectName" from="${projects}" required="" noSelection="['':'Please select...']" value="${taskInstance?.projectName}" valueMessagePrefix="task.projectName"/>
</div>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'activityNumber', 'error')} required">
	<label for="activityNumber">
		<g:message code="task.activityNumber.label" default="Activity Number" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="activityNumber" required="" value="${taskInstance?.activityNumber}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'feedbackNumber', 'error')} ">
	<label for="feedbackNumber">
		<g:message code="task.feedbackNumber.label" default="Feedback Number" />

	</label>
	<g:textField name="feedbackNumber" value="${taskInstance?.feedbackNumber}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'description', 'error')} required">
	<label for="description">
		<g:message code="task.description.label" default="Description" />
		<span class="required-indicator">*</span>
	</label>
	<g:textArea name="description" required="" value="${taskInstance?.description}" maxLength="254"/>
</div>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'actionType', 'error')} required">
	<label for="actionType">
		<g:message code="task.actionType.label" default="Action Type" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="aType" name="actionType" from="${taskInstance.constraints.actionType.inList}" required="" value="${taskInstance?.actionType}" valueMessagePrefix="task.actionType"/>
</div>

<div id="priorityDiv" class="fieldcontain ${hasErrors(bean: taskInstance, field: 'priority', 'error')} required">
	<label for="priority">
		<g:message code="task.priority.label" default="Priority" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="priority" from="${taskInstance.constraints.priority.inList}" required="" value="${taskInstance?.priority}" valueMessagePrefix="task.priority"/>
</div>

<div id="dTypeDiv" class="fieldcontain ${hasErrors(bean: taskInstance, field: 'documentType', 'error')} required">
	<label for="documentType">
		<g:message code="task.documentType.label" default="Document Type" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="documentType" from="${taskInstance.constraints.documentType.inList}" required="" value="${taskInstance?.documentType}" valueMessagePrefix="task.documentType"/>
</div>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'receivedDate', 'error')} required">
	<label for="receivedDate">
		<g:message code="task.receivedDate.label" default="Received Date" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="receivedDateTemp" id="receiveddatepicker" value="${receivedDateTemp}" readonly="true"/>
</div>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'dueDate', 'error')} required">
	<label for="dueDate">
		<g:message code="task.dueDate.label" default="Due Date" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="dueDateTemp" id="duedatepicker" value="${dueDateTemp}" readonly="true"/>
</div>

<%--<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'completedDate', 'error')}">
	<label for="completedDate">
		<g:message code="task.completedDate.label" default="Completed Date" />
	</label>
	<g:textField name="completedDateTemp" id="completeddatepicker" value="${completedDateTemp}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'status', 'error')} ">
	<label for="status">
		<g:message code="task.status.label" default="Status" />

	</label>
	<g:select name="status" from="${taskInstance.constraints.status.inList}" value="${taskInstance?.status}" valueMessagePrefix="task.status" noSelection="['': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'rootCause', 'error')} ">
	<label for="rootCause">
		<g:message code="task.rootCause.label" default="Root Cause" />

	</label>
	<g:select name="rootCause" from="${taskInstance.constraints.rootCause.inList}" value="${taskInstance?.rootCause}" valueMessagePrefix="task.rootCause" noSelection="['': '']" />
</div>
--%>

<div id="ptsHourDiv" class="fieldcontain ${hasErrors(bean: taskInstance, field: 'ptsHour', 'error')} required">
	<label for="ptsHour">
		<g:message code="task.ptsHour.label" default="PTS Hour" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="ptsHour" type="number" value="${taskInstance.ptsHour}" required="" min="0"/>
</div>

<%--<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'estimateHour', 'error')} required">
	<label for="estimateHour">
		<g:message code="task.estimateHour.label" default="Estimate Hour" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="estimateHour" type="number" value="${taskInstance.estimateHour}" required="" min="0"/>
</div>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'developer', 'error')} ">
	<label for="developer">
		<g:message code="task.developer.label" default="Developer" />

	</label>
	<g:select name="developer" from="${developerResources}" value="${taskInstance?.developer}" noSelection="['':'Please select...']" maxLength="60" valueMessagePrefix="task.developer"/>
</div>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'tester', 'error')} ">
	<label for="tester">
		<g:message code="task.tester.label" default="Tester" />

	</label>
	<g:select name="tester" from="${testerResources}" value="${taskInstance?.tester}" noSelection="['':'Please select...']" maxLength="60" valueMessagePrefix="task.tester"/>
</div>
--%>

<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'comments', 'error')} ">
	<label for="comments">
		<g:message code="task.comments.label" default="Comments" />

	</label>
	<g:textArea name="comments" value="${taskInstance?.comments}" maxLength="254"/>
</div>

<div id="testByGDCFlagDiv" class="fieldcontain ${hasErrors(bean: taskInstance, field: 'testByGDCFlag', 'error')} ">
	<label for="testByGDCFlag">
		<g:message code="task.testByGDCFlag.label" default="GDC QA" />

	</label>
	<g:select name="testByGDCFlag" from="${taskInstance.constraints.testByGDCFlag.inList}" value="${taskInstance?.testByGDCFlag}" valueMessagePrefix="task.testByGDCFlag" />
</div>

<%--<div class="fieldcontain ${hasErrors(bean: taskInstance, field: 'closedFlag', 'error')} ">
	<label for="closedFlag">
		<g:message code="task.closedFlag.label" default="Closed Flag" />

	</label>
	<g:select name="closedFlag" from="${taskInstance.constraints.closedFlag.inList}" value="${taskInstance?.closedFlag}" valueMessagePrefix="task.closedFlag" noSelection="['':'Please select...']"/>
</div>
--%>